from config import BASE_URL
from page.page_back_login import BackLoginPage
from script import log
from tools import DriverTools


class TestBackLogin(object):
    def setup_method(self):
        driver = DriverTools.get_driver()
        driver.get("http://121.43.169.97:8082/")
        self.back_login = BackLoginPage(driver)

    def teardown_method(self):
        DriverTools.quit_driver()

    def test01_back_login_success(self):
        self.back_login.back_login("admin", "HM_2023_test")
        result = self.back_login.get_success_result()
        print(result)
        log.info(f"执行结果：{result}")

        assert "欢迎光临" in result
        self.back_login.get_shot("back_login_success.png")
